package ifmo.compiler.task21.parser.symbols;


public abstract class Symbol {
	private String _value;
	private SymbolType _type;
	
	public Symbol(SymbolType type)
	{
		_type = type;
	}
	
	public Symbol(String value, SymbolType type)
	{
		_value = value;
		_type = type;
	}
	
	public String getValue()
	{
		return _value;
	}
	
	public void setValue(String value)
	{
		_value = value;
	}
	
	public boolean equals(Object obj)
	{
		if (obj instanceof Symbol)
		{
			Symbol symb = (Symbol)obj;
			if (symb._value == _value)
			{
				return true;
			}
		}
		
		return false;
	}
	
	public int hashCode()
	{
		return _value.hashCode();
	}
	
	public String toString()
	{
		return _value;
	}
	
	public SymbolType getType()
	{
		return _type;
	}
	
	static public Symbol getEpsilon()
	{
		return new Epsilon();
	}
}
